#!/bin/bash

# ----------------------------------------------------------------------------
#  MailClientSdk init script, version 1.0.0
#
# ----------------------------------------------------------------------------

sh ./buildSdk.sh
cd ../
TEMP_PATH="./build_essential/mail_client_sdk/build/default/outputs/default/mail_client_sdk.har"
[[ ! -e "./sample/sdk" ]] && mkdir ./sample/sdk
OUTPUT_PATH="./sample/sdk/mail_client_sdk.har"

[[ -e "$OUTPUT_PATH" ]] && echo deleting history output file ... && rm -rf "$OUTPUT_PATH"


# 将har包拷贝到sample中
if [[ -e "$TEMP_PATH" ]]; then
  echo copying...
  cp -r $TEMP_PATH $OUTPUT_PATH
  echo done.
else
  echo build failed.
fi
